fix(configs): read the extraConfig block of a shelley genesis - #797
fix(configs): read the extraConfig block of a shelley genesis#797geofflittle wants to merge 1 commit into
Conversation
- injection.rs: the arms, and one populated source or a refusal - shelley.rs: fold the three fields, prefer the current pool names - refuse an extraConfig key or an injection key nothing reads
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughAdds shared ChangesShelley genesis injection
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The Shelley genesis compatibility update is covered across new and existing fixture shapes, with no actionable merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 73.91% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 46 functions across 3 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What?
This PR adds an
injectionmodule that reads theextraConfigblock of a shelley genesis file. For each field in the file, it picks between the new injected value and the old top level value. It uses whichever holds entries (injected or top level) and refuses if both do. The shelley parser uses it for the three fields that can appear inextraConfig: initial funds, stake pools, and stake credentials.The PR also has Pool entries now parse under the
poolIdandaccountAddressnames, which are the ledger's current names for those fields (as well as still parsing the oldpublicKeyandrewardAccount).Why?
cardano-cli11.2.0.0 changed the format of the generated genesis file. It now has initial funds, pools, credentials, delegations, and initial DReps underextraConfigin the shelley and conway files and leaves the old top level fields empty (changelog at the tag, marked breaking).pallas-configsreads only the top level and not the changed injected fields, so pallas parses a genesis written by current tooling without error, reads it as empty, and so yields a chain that has no funds and no pools.The published Musashi shelley genesis is a file generated by the new tool (pinned copy, blake2b-256
735d3f9f1f79066ead4ef7df4ac7e6ed25e8d78b7b9c7e5ec5ee1b88476e1c3f, which is theShelleyGenesisHashitsconfig.jsondeclares). All 30000000900000000 lovelace of its supply is underextraConfig, its byron genesis has no funds at all and pallasmainparses it to yield zero utxos.Testing done
Added tests. One loads that Musashi genesis, asserts its top level
initialFundsis empty, and asserts the utxos computed from it add up to the full 30000000900000000 lovelace. The rest use a fixture generated bycardano-cli 11.2.2.0 genesis create-testnet-dataand committed exactly as the tool wrote it. The injection-vs-top-level resolve rule is tested case by case, each of the three shelley fields is tested end to end including its refusal, and the four existing fixtures still parse to what they did before.Notes
Three places this change deliberately differs from how the ledger resolves the same fields:
fileinjection, one that names a separate file and its hash instead of holding the data inline, is refused rather than read. This would've caused a larger change that would require the parser to need to know about the path to the file that seemed unnecessary to add to this PR.Summary by CodeRabbit
extraConfig, including initial funds, stake pools, and stake credentials.